package week08;
		import java.util.*;
		public class Main {
			public static void main(String[] args) {
				int[]arr=new int[5];
				Scanner sc = new Scanner(System.in);
				while(true){
					try{
						switch(sc.next()){
						case"arr":
							int c=arr[sc.nextInt()];
							break;
							  
						case"null":
							throw new
							NullPointerException();
							
						case"cast":
							Object obj=new String("o");
							Integer h=(Integer)obj;
							throw new ClassCastException();
							
		                case"num":
							Integer.parseInt(sc.next());
							befault:
								break;
						}
					}catch(ArrayIndexOutOfBoundsException e){
						System.out.println(e);
					}
					catch(NullPointerException e){
						System.out.println(e);
					}
					catch(ClassCastException e){
						System.out.println(e);
					}
					catch(NumberFormatException e){
					System.out.println(e);
				}
			
				}
			}
		


	}


